package com.lee.transactionaldemo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.Random;
import java.util.UUID;
import java.util.stream.IntStream;

/**
 * <p>
 * 
 * </p>
 *
 * @author jobob
 * @since 2021-04-22
 */
@Data
@TableName("user")
public class User{

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    private String name;


    private static String suffix(){
        Random random = new Random();
        int i = random.nextInt(9999);
        return String.valueOf(i);
    }


    public static User createA(){
        User user = new User();
        user.setName("A-"+suffix());
        return user;
    }

    public static User createB(){
        User user = new User();
        user.setName("B-"+suffix());
        return user;
    }




}
